import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MonitorAreaVO, MonitorAreaForm, MonitorAreaQuery } from '@/api/wvp/monitorArea/types';

/**
 * 查询监控区域列表
 * @param query
 * @returns {*}
 */

export const listMonitorArea = (query?: MonitorAreaQuery): AxiosPromise<MonitorAreaVO[]> => {
  return request({
    url: '/wvp/monitorArea/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询监控区域详细
 * @param maId
 */
export const getMonitorArea = (maId: string | number): AxiosPromise<MonitorAreaVO> => {
  return request({
    url: '/wvp/monitorArea/' + maId,
    method: 'get'
  });
};

/**
 * 新增监控区域
 * @param data
 */
export const addMonitorArea = (data: MonitorAreaForm) => {
  return request({
    url: '/wvp/monitorArea',
    method: 'post',
    data: data
  });
};

/**
 * 修改监控区域
 * @param data
 */
export const updateMonitorArea = (data: MonitorAreaForm) => {
  return request({
    url: '/wvp/monitorArea',
    method: 'put',
    data: data
  });
};

/**
 * 删除监控区域
 * @param maId
 */
export const delMonitorArea = (maId: string | number | Array<string | number>) => {
  return request({
    url: '/wvp/monitorArea/' + maId,
    method: 'delete'
  });
};
